package cn.tedu.pojo;
//充当了MVC里的Model层,封装数据
public class Car {
    private int id ;
    private String name ;
    private String type ;
    private String color ;
    private double price ;
    //constructor
    public Car() { }
    public Car(int id, String name) {
        this.id = id;
        this.name = name;
    }
    //get/set
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getColor() {
        return color;
    }
    public void setColor(String color) {
        this.color = color;
    }
    public double getPrice() {
        return price;
    }
    public void setPrice(double price) {
        this.price = price;
    }
    //toString -- 默认使用的Object的,展示地址值.重写后就展示了属性值
    @Override
    public String toString() {
        return "Car{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", type='" + type + '\'' +
                ", color='" + color + '\'' +
                ", price=" + price +
                '}';
    }
}
